<template>
  <div class="recommend">
    <recommend-swiper :swiperList="swiperList"></recommend-swiper>
    <recommend-radio :radioList="radioList"></recommend-radio>
  </div>
</template>
<script>
import { getRecommend } from 'api/recommend'
import { ERR_OK } from 'api/params.config'
import RecommendSwiper from './components/Swiper'
import RecommendRadio from './components/Radio'

export default {
  name: 'MusicRecommend',
  components: {
    RecommendSwiper,
    RecommendRadio
  },
  data () {
    return {
      swiperList: [],
      radioList: []
    }
  },
  created () {
    this.getRecommendInfo()
  },
  methods: {
    getRecommendInfo () {
      getRecommend().then((res) => {
        if (res.code === ERR_OK) {
          let data = res.data
          this.swiperList = data.slider
          this.radioList = data.radioList
        }
      })
    }
  }
}
</script>
<style lang="stylus" scoped>

</style>
